﻿namespace BridgeShips
{
    /// <summary>
    /// 实体基类
    /// </summary>
    public class EntityBase
    {
        /// <summary>
        /// 实体数据
        /// </summary>
        private EntityStatus m_EntityStatus;
        /// <summary>
        /// 获取实体状态
        /// </summary>
        public EntityStatus Status
        {
            protected set
            {
                m_EntityStatus = value;
            }
            get
            {
                return m_EntityStatus;
            }
        }
        /// <summary>
        /// 管理器对象管理
        /// </summary>
        private Managers m_Managers;
        /// <summary>
        /// 管理器对象管理
        /// </summary>
        protected Managers Managers
        {
            get
            {
                return m_Managers;
            }
        }

        /// <summary>
        /// 初始化接口
        /// </summary>
        public virtual void Init(EntityData data)
        {
            m_EntityStatus = new EntityStatus(data);
            m_Managers = new Managers();
        }

        /// <summary>
        /// 初始化完成接口
        /// </summary>
        public void InitDown()
        {
            
        }
        /// <summary>
        /// 轮询接口
        /// </summary>
        /// <param name="frameTime">逻辑一帧时间</param>
        /// <param name="realTime">实际一帧时间</param>
        public void Update(float frameTime, float realTime)
        {
            Managers.Update(frameTime, realTime);
        }
        public void Release()
        {
            Managers.Release();
            Status.Release();
        }
    }
}
